package cn.zyq.ykb.beans.config;

import cn.zyq.ykb.system.annotation.Excel;
import cn.zyq.ykb.system.common.BaseBean;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 配置-道具订单对象 configPropOrder
 *
 * @author SystemAuth
 * @date 2023-05-30
 */
@Data
@Entity
@Table(name = "`configPropOrder`")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class ConfigPropOrder  extends BaseBean implements Serializable {
    /**
     * 主键id，用于关联
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "JDBC")
    @Column(name = "`configPropOrderID`")
    @ApiModelProperty("主键id，用于关联")
    private Integer configPropOrderID;
    /**
     * 订单编号
     */
    @Column(name = "`orderCode`")
    @Excel(name = "订单编码")
    @ApiModelProperty("订单编号")
    private String orderCode;
    /**
     * 道具ID
     */
    @Column(name = "`configPropID`")
    @ApiModelProperty("道具ID")
    private Integer configPropID;
    /**
     * 用户ID
     */
    @Column(name = "`userID`")
    @ApiModelProperty("用户ID")
    private Integer userID;
    /**
     * 支付类型
     */
    @Column(name = "`payType`")
    @Excel(name = "支付类型",readConverterExp ="1=微信支付,2=支付宝支付")
    @ApiModelProperty("支付类型")
    private Integer payType;
    /**
     * 订单金额
     */
    @Column(name = "`price`")
    @Excel(name = "订单金额")
    @ApiModelProperty("订单金额")
    private BigDecimal price;
    /**
     * 订单状态（1待支付，2支付成功，3支付失败）
     */
    @Column(name = "`orderState`")
    @Excel(name = "订单状态",readConverterExp ="1=待支付,2=支付成功,3=支付失败")
    @ApiModelProperty("订单状态（1待支付，2支付成功，3支付失败）")
    private Integer orderState;
    /**
     * 支付时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "`payTime`")
    @ApiModelProperty("支付时间")
    private LocalDateTime payTime;
    /**
     * 完成时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "`finishTime`")
    @ApiModelProperty("完成时间")
    private LocalDateTime finishTime;
    /**
     * 支付过期时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "`payExpireTime`")
    @ApiModelProperty("支付过期时间")
    private LocalDateTime payExpireTime;
    /**
     * 第三方支付请求响应信息
     */
    @Column(name = "`payReqRespInfo`")
    @ApiModelProperty("第三方支付请求响应信息")
    private String payReqRespInfo;
    /**
     * 实际支付金额
     */
    @Column(name = "`actualPayAmount`")
    @ApiModelProperty("实际支付金额")
    private BigDecimal actualPayAmount;


    @Transient
    @ApiModelProperty("道具列表")
    private ConfigProp configProp;

    @Transient
    @Excel(name = "道具名称",readConverterExp ="1=刷新道具,2=置顶道具")
    @ApiModelProperty("道具名称")
    private Integer type;

    @Transient
    @ApiModelProperty("用户名")
    @Excel(name = "用户")
    private  String nickName;

}
